/**
 * 
 */
package de.tum.in.eist.poll.server;

import com.google.gwt.user.server.rpc.RemoteServiceServlet;

import de.tum.in.eist.poll.client.Feedback;
import de.tum.in.eist.poll.client.PollService;

/**
 * @author Chris
 *
 */
public class PollServiceImpl extends RemoteServiceServlet implements
		PollService {


	/**
	 * 
	 */
	private static final long serialVersionUID = 1L;

	@Override
	public boolean submitFeedback(Feedback feedback) {
		
		int lID = feedback.getLecture().getLectureID();
		
		if(!CookieManager.cookieExists(lID))
		{
			Database.addFeedbackToLecture(lID, feedback);
			CookieManager.setCookie(lID);
			return true;
			
		}
		
		return false;
	}

}
